#include "generator.h"
#include <QDebug>
#include <QThread>
#include "spdlog/spdlog.h"
#include "loggername.h"

Generator::Generator(QObject *parent) : QObject(parent)
{

}

Generator::~Generator()
{
    spdlog::get(LOGGER_NAME)->info("#@###################");
}

void Generator::doWork()
{
    qDebug() << "receive the execute signal---------------------------------";
    qDebug() << "     current thread ID:" << QThread::currentThreadId();
    //循环一百万次
    for (int i = 0; i != 1000; ++i)
    {
    }
    //发送结束信号
    qDebug() << "      finish the work and sent the resultReady signal\n";
    emit resultReady(1000);
}
